ga.core.individual
Class TemplateIndividualFactory<T extends IIndividual<T>>

java.lang.Object
  extended by ga.core.individual.TemplateIndividualFactory<T>
Type Parameters:
T - The generic type of individuals.
All Implemented Interfaces:
IIndividualFactory<T>

public class TemplateIndividualFactory<T extends IIndividual<T>>
extends java.lang.Object
implements IIndividualFactory<T>

This factory creates new individuals by cloning a template.

Since:
11.08.2012
Author:
Stephan Dreyer

Field Summary
private  T template
           
 
Constructor Summary
TemplateIndividualFactory(T template)
          Creates a new factory with the template.
 
Method Summary
 T newIndividual(GAContext context)
          Creates a new individual in the given context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

template

private final T extends IIndividual<T> template
Constructor Detail

TemplateIndividualFactory

public TemplateIndividualFactory(T template)
Creates a new factory with the template.

Parameters:
template - The individual template that will be cloned.
Since:
11.08.2012
Method Detail

newIndividual

public T newIndividual(GAContext context)
Description copied from interface: IIndividualFactory
Creates a new individual in the given context.

Specified by:
newIndividual in interface IIndividualFactory<T extends IIndividual<T>>
Parameters:
context - The context.
Returns:
The new individual.